package com.goldplusgold.tradedelay.app.home.networkserivce;

import com.goldplusgold.network.lib.ApiProxyFactory;
import com.goldplusgold.tradedelay.app.home.pojo.ArticleList;
import com.goldplusgold.tradedelay.app.home.pojo.BannerList;
import com.goldplusgold.tradedelay.app.home.pojo.TDLogin;

/**
 * Created by admin on 2017/5/8.
 */

public class HomeService {
    private static HomeService sSingltone;
    private final ApiHome mApiHome;

    public HomeService() {
        mApiHome = ApiProxyFactory.getProxy(ApiHome.class);
    }

    public static synchronized HomeService getInstance() {
        if (sSingltone == null) {
            sSingltone = new HomeService();
        }

        return sSingltone;
    }


    public BannerList getBannerList() throws Exception {
        return mApiHome.getBannerList();
    }

    public ArticleList getArticleList(int offset, int count, String newsType) throws Exception {
        return mApiHome.getArticleList(offset, count, newsType);
    }
    public TDLogin getTDLoginState() throws Exception {
        return mApiHome.getTDLoginState();
    }

}
